import {WrapIssueForTable} from 'gitee-simple-db'

const HistoryTable = new WrapIssueForTable("history", {useCommentIdAsId: true, useUpdateDate: true})

const getAll = async () => {
    return await HistoryTable.getAllData()
}
const getOne = async(id: number) => {
    return await HistoryTable.getOneData(id)
}
const addOne = async(data: any) => {
    return await HistoryTable.addOneData(data)
}
const updateOne = async(data: any) => {
    return await HistoryTable.updateOneData(data)
}
const deleteOne = async(id: number) => {
    return await HistoryTable.deleteOneData(id)
}
const getDataByPage = async(pageParam: {page: number, per_page: number}) => {
    return await HistoryTable.getDataByPage(pageParam)
}
export const HistoryOperation = {
    getAll,
    getOne,
    addOne,
    updateOne,
    deleteOne,
    getDataByPage,
}